<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <title>后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <!--<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">-->
    <link rel="stylesheet" href="/plugin/elementUI/elementUI.css">
    <link rel="stylesheet" href="/font-awesome/css/font-awesome.min.css">
</head>
<body>
    <div class="main">
        <div v-show="showList">
            <el-row type="flex" justify="start">
                <el-col :span="4">
                    <el-input placeholder="请输入用户名" icon="search" v-model="queryParam.user_name" :on-icon-click="query" v-on:keyup.enter="query" />
                </el-col>
                <el-col :span="20">
                    <div align='right'>
                        <shiro:hasPermission name="sys:file:add">
                            <el-button type="primary" @click="changeAddOrEdit('add')" icon="plus">新增</el-button>
                        </shiro:hasPermission>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-table ref="table" :data="page.dataList" border
                              tooltip-effect="dark" style="width: 100%" @selection-change="getSelected">
                        <el-table-column type="selection" width="55" prop="uid" />

                        <el-table-column type="index" label="序号" width="80" prop="menu_id" />

                        <el-table-column prop="url" label="URL" width="500" />

                        <el-table-column prop="memo" label="描述" sortable />

                    </el-table>
                    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page.pageNo" :total="page.total"
                                   :page-sizes="[10, 20, 50, 100]" :page-size="page.pageSize" layout="total, sizes, prev, pager, next, jumper" />
                </el-col>
            </el-row>
        </div>
        <div v-show="!showList">
            <el-form label-position="right" label-width="20%" ref="form" >
                <el-row type="flex" justify="start">
                    <el-col :span="10">
                        <el-upload class="upload-demo" drag :auto-upload="false" ref="upload" name="file"
                                action="/file/add" multiple :data="form" :on-success="success">
                            <i class="el-icon-upload"></i>
                            <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                        </el-upload>
                        <el-input
                                type="textarea"
                                :autosize="{ minRows: 2, maxRows: 4}"
                                placeholder="请输入内容"
                                v-model="form.memo">
                        </el-input>
                    </el-col>
                </el-row>
                <el-row type="flex" justify="start" :gutter="20">
                    <el-col  :span="6" :offset="5">
                        <el-form-item >
                            <el-button type="primary" @click="addOrEdit" v-loading.fullscreen.lock="loading">{{text.submitButtonText}}</el-button>
                            <el-button type="info" @click="goBack">返回</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </div>
    </div>

    <script type="text/javascript" src="/plugin/jQuery.js"></script>
    <script type="text/javascript" src="/plugin/vue.js"></script>
    <script type="text/javascript" src="/plugin/elementUI/elementUI.js"></script>
    <script type="text/javascript" src="/js/file.js"></script>
</body>
</html>